In typical web applications, data are presented to a user by formatting the data as HTML documents using template processing. In template processing, a document, such as a web page, can be generated using structured input data and a template. The structured input data contain the data to be presented in the document and the template specifies the layout of the document and how to bind the input data to the document. In certain web applications, template processing either happens at a server with the generated HTML document being sent to a client device (e.g. a web browser). Alternatively, the template processing happens at a client device where the template and the input data are sent to the client device separately and the template processing is executed at the client device.
Developments in template processing have allowed for template processing at both the server and the client device and for dynamic shifting between template processing at the server and at the client device. For instance, a first version of the input data can be processed at the server to generate an HTML document that is sent to the client device. The generated HTML document can also serve as a template available for processing at the client device. As new input data become available at the client device, the client device can process the HTML document (which also acts as a template) to generate an updated HTML document.
In certain cases, a template can be dependent on multiple different input data that are not available in the same location. For example, some of the input data can be available only at the server. Other input data can be available only at the client device. Other input data can be available at both the server and the client device. The input data available at the client device can have a different data structure type than input data available at the server.
Techniques for processing templates that that are dependent on input data available in different locations include processing separate templates at the server and at the browser. Alternatively, the same template can be processed at the server and the browser, but the same input data needs to be supplied at both locations. Data that is not available, such as data available only on a client device, can be replaced by dummy data during template processing at the server. The template with the dummy data can then be sent to client device for reprocessing based on input data that become available at the client device.